package com.gzm.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName MySelfRule
 * @Description:
 * @Author gzm
 * @Date 2020/11/23 16:04
 **/
//该类不要放到CompantScan包下或者子包下
@Configuration
public class MySelfRule {

    @Bean
    public IRule myrule(){
        //Ribbon定义的是轮询,我改成随机
        return new RandomRule_GZM();
    }
}
